package com.zkthink.ceres.app.product.controller;

import com.zkthink.base.R;
import com.zkthink.ceres.common.annotations.LoginMode;
import com.zkthink.ceres.common.enums.YesOrNoEnum;
import com.zkthink.ceres.product.entity.ResourcePit;
import com.zkthink.ceres.product.entity.Subject;
import com.zkthink.ceres.product.service.ResourcePitService;
import com.zkthink.database.mybatis.conditions.Wraps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Validated
@RestController
@RequestMapping("/resourcePit")
@AllArgsConstructor
@LoginMode(strict = false)
@Api(value = "蛋坑接口", tags = "蛋坑接口")
public class ResourcePitController {

    @Autowired
    private ResourcePitService resourcePitService;

    @GetMapping({"/queryResourcePit"})
    @ApiOperation("查询蛋坑")
    public R<List<ResourcePit>> queryResourcePit() {
        return R.success(resourcePitService.list(Wraps.<ResourcePit>lbQ().eq(ResourcePit::getIsDelete, YesOrNoEnum.NO.getCode())));
    }

}
